home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / bench / x.txt / 000289_shifeux@hotmail.com_Wed Jan 9 12:53:37 EST 2002.msg < prev    next >
Text File  |  2020-01-01  |  4KB  |  123 lines

  1. Article: 13122 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!panix!bloom-beacon.mit.edu!newsfeed.stanford.edu!postnews1.google.com!not-for-mail
  3. From: shifeux@hotmail.com (Shifeux)
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: Re: Kermit 8 FTP scripting
  6. Date: 9 Jan 2002 08:20:29 -0800
  7. Organization: http://groups.google.com/
  8. Lines: 104
  9. Message-ID: <336f652d.0201090820.6b98e5cc@posting.google.com>
  10. References: <336f652d.0201081116.4cd7a675@posting.google.com> <a1fhgv$sgj$1@watsol.cc.columbia.edu>
  11. NNTP-Posting-Host: 208.178.159.150
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14. X-Trace: posting.google.com 1010593230 18705 127.0.0.1 (9 Jan 2002 16:20:30 GMT)
  15. X-Complaints-To: groups-abuse@google.com
  16. NNTP-Posting-Date: 9 Jan 2002 16:20:30 GMT
  17. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:13122
  18.  
  19. I love you. 
  20.  
  21. > First of all, I assume these IF FAIL commands don't have line breaks in your
  22. > actual script.  If they do, of course, the script has illegal syntax.  So
  23. > what you meant to write was:
  24. >   ftp cd \tmp\hello\
  25. >   if success write TRANSACTION-LOG FTP Server Message: \v(ftp_message)\13\10
  26. >   if fail write TRANSACTION-LOG FTP Server Message: \v(ftp_message)\13\10
  27.  
  28. Yep, I use google to post to the newsgroup and the lines wrap when I
  29. paste into them.
  30.  
  31. > Second: You can eliminate the ugly \13\10 notation as follows:
  32. >   ftp cd \tmp\hello\
  33. >   if success writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
  34. >   if fail writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
  35.  
  36. All my code is ugly, but this is much better!
  37.  
  38. > Third: You shouldn't put an IF FAIL command after an IF SUCCESS command
  39. > unless you really mean to; I don't think that's what you want in this.  So:
  40. >   ftp cd \tmp\hello\
  41. >   if success {
  42. >       writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
  43. >   } else {
  44. >    writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
  45. >   }
  46.  
  47. this is exactly what I intended to do, I tried the if,then,else
  48. originally but gave up after no success. I'll do it this way.
  49.  
  50.  
  51. > Fourth: Since the IF and ELSE commands are identical, you don't need
  52. > the IF statement at all:
  53. >   ftp cd \tmp\hello\
  54. >   writeln TRANSACTION-LOG FTP Server Message: \v(ftp_message)
  55.  
  56. I was using the if,then to get both success or failure messages into
  57. the logfile, not just the server ftp message
  58.  
  59. > Fifth: Backslash is a special character in Kermit commands.  You might need
  60. > to double them in your FTP CD command:
  61. >   ftp cd \\tmp\\hello\\
  62. > Or try:
  63. >   ftp cd /tmp/hello/
  64.  
  65. i didn't have any backslash problems at all
  66.  
  67. > which might be accepted by the server.
  68. > : I can't seem to add in an exit command to the if fail line. If i have:
  69. > : 
  70. > :     if fail exit 1 write TRANSACTION-LOG FTP Server message:
  71. > : \v(ftp_message)
  72. > : 
  73. > : the transaction log is never written.
  74. > :
  75. > Did you give a LOG TRANSACTIONS command to open it?
  76.  
  77. yes i just didn;t paste that into my post
  78.  
  79. > The optional EXIT command arguments are (1) a number (exit status code) and
  80. > (2) a message to print (not a command to execute).
  81. > : How and i string along more than
  82. > : 1 command in this statement? A (,) does not do the trick.
  83. > : 
  84. > The way to group commands in an IF statement is:
  85. >   if <condition> {
  86. >        command
  87. >        command
  88. >        ...
  89. >   }
  90. > Of course you can also have an ELSE part with one or more commands:
  91. >   if <condition> {
  92. >        command
  93. >        command
  94. >        ...
  95. >   } else {
  96. >        command
  97. >        command
  98. >        ...
  99. >   }
  100. > In your case:
  101. >   if fail {
  102. >        writeln TRANSACTION-LOG FTP Server message: \v(ftp_message)
  103. >        exit 1
  104. >   }
  105. > - Frank
  106.  
  107. Thank you very much for the help, you are my hero.
  108.